﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZG_member.Model;
using System.Data.SqlClient;
using System.Data;
using Maticsoft.DBUtility;

namespace ZG_member.DAL
{
    public class integral
    {
        public bool Update(ZG_member.Model.integral model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update integral set ");
            strSql.Append("Userintegral=@Userintegral,");
            strSql.Append("consume=@consume,");

            strSql.Append(" where membercardID=@membercardID");
            SqlParameter[] parameters = {
					new SqlParameter("@Userintegral", SqlDbType.NVarChar,50),
					new SqlParameter("@consume", SqlDbType.NVarChar,50),
					new SqlParameter("@membercardID", SqlDbType.NVarChar,50)};
					
            parameters[0].Value = model.Userintegral1;
            parameters[1].Value = model.Consume;
            parameters[2].Value = model.MembercardID;
            

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }





    }
}
